tools/xenstored: Avoid buffer overflows while setting up sockets
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 25 Nov 2013 14:38:41 +0000 (14:38 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 13 Dec 2013 18:26:29 +0000 (18:26 +0000)
commite423b5cd60ff95ba3680e2e4a8440d4d19b2b13e
tree6754e5d25b54dbf41729a0c9ac0cb1abddd9d4fe
parent5d71457def05299bfa69276bb7f31db705f05f19
tools/xenstored: Avoid buffer overflows while setting up sockets

Coverity ID: 1055996 1056002

Cache the xs_daemon_socket{,_ro}() strings to save pointlessly
re-snprintf()'ing the same path, and add explicit size checks against
addr.sun_path before strcpy()'ing into it.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Matthew Daley <mattd@bugfuzz.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/xenstore/xenstored_core.c